
/*

Design Pattern Automation Toolkit.
Application to create applications with emphasis on Design patterns.
And support for round trip engineering.
Copyright (C) 2004 Vineeth Neelakant. nvineeth@gmail.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
using System.Drawing;
using System.Windows.Forms;
using DesignPatternDefinitions;
namespace BusinessLayer
{
	public interface IDesignPatternSubject
	{
		bool CreateNewProject(IProject proj);
		
		IProject ProjectDetails{get;set;}
		
		bool CreateNewComponent(IProjectComponent component);
		bool DeleteComponent(string compName);
		bool UpdateComponentDetails(IProjectComponent oldComp, IProjectComponent newComp);
		
		bool WriteProject();
		bool WriteProject(string fname);
		bool ReadProject(string fname);
		bool ReadProject();//overloaded for convenience!
		
		bool AddClass(IClass c);
		bool RenameClass(string component,string oldname,string newname);
		bool AddField(string componentName,string className , IField fld);
		bool RemoveField ( string componentName,string className, IField fld);

		bool AddMethod( string componentName,string className,IMethod mthd);
		bool RemoveMethod ( string componentName,string className,IMethod mthd);

		bool AddParameter( object uniqueMethodId, IParameter param);

		bool AddInheritance( IInheritance inh,bool addBaseClassMembers);
		bool RemoveInheritance( IInheritance inh);

		bool AddReference( IReference rf);
		bool RemoveReference( IReference rf);
		bool UpdateReference( IReference oldRef, IReference newRef);

		bool AddAggregate( IAggregate agg);
		bool RemoveAggregate( IAggregate agg);
		bool UpdateAggregate(IAggregate oldAgg, IAggregate newAgg);

		bool AddCreates( ICreation creates);
		bool RemoveCreates( ICreation creates);
		bool UpdateCreates(ICreation oldCr , ICreation newCr);
		
		void ShowClassEditor( string comp , string cname,object specificVal);
			
		void RegisterDelegates(
			string compName ,
			AddNewClassObserver anco,
			ClassNameObserver cno, 
			ClassFieldObserver cfo , 
			ClassMethodObserver cmo,
			RelationObserver relObs,
			ReInitialize delClsObs);

		void AddClassUIDetails( string compName , string cName , Point p);
		void AddComponentUIDetails(string compName,int width,int height);
		bool ContainsClass(string comp,string cname);
		
		void DeleteClass(string comp,string cname);
		
		IProject GetProject();
		void SetProject( IProject project);
		
		void UpdateComponents();
		
		void UpdateComponent( string compName );
		
		void Merge( string curcomp,string pathToPatternFile);

		bool AutoUIUpdate{get;set;} //Tells to update the ui relations automatically or will it be done manually!
		bool Silent{get;set;}//Tells to hide the error messages
		string GetTag();
		void Dispose();
	}
}
